//package com.design_pattern.composite;
//
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Objects;
//
//public class TreeBuilder {
//    private List<Node> nodeList;
//
//    public  TreeBuilder(List<Node> nodeList) {
//        this.nodeList = nodeList;
//    }
//
//    public  Node buildTree(){
//
//        Node rootNode = getRootNode(0);
//        if(Objects.isNull(rootNode)){
//            return null;
//        }
//
//
//        return null;
//
//
//    }
////
////    private void startBuild(Node node) {
////       List<Node> childrenNodeList = getChildrenNodeList(node.getId());
////       if(!childrenNodeList.isEmpty()){
////           for (Node childNode : childrenNodeList) {
////               startBuild(childNode);
////           }
////
////       }
////    }
////
////    private List<Node> getChildrenNodeList(Integer nodeId) {
////        List<Node> childrenNodeList = new ArrayList<>();
////        for (Node node : nodeList) {
////            if(Objects.equals(node.getPid(),nodeId)){
////                childrenNodeList.add(node);
////            }
////        }
////        return childrenNodeList;
////    }
////
////    private Node getRootNode(Integer rootId) {
////        for (Node node : nodeList) {
////            if(Objects.equals(node.getId(),rootId)){
////                return node;
////            }
////        }
////        return null;
////
////
////    }
//}
